package cn.tedu.test.lbs.thread_local;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class MyFilter {
    private MyDispatcher dispatcher=new MyDispatcher();
    //main方法模拟请求开始进入 调用流程
    public static void main(String[] args) {
        new MyFilter().doFilter();
    }
    public void doFilter(){
        log.info("过滤器组件开始执行");
        String name="王翠花";
        Thread thread = Thread.currentThread();
        log.info("当前线程:{}",thread.getId());
        //执行threadLocal.put(name)
        ThreadLocalUtil.save(name);
        dispatcher.service();
    }
}
